package com.imc.griebeler.visitor;

public class Main {
	public static void main(String[] args) {
		Shape[] shapes = new Shape[] {
				new Rectangle(2, 4),
				new Circle(6),
				new Triangle(8, 4)
		};
		
		AreaVisitor areaVisitor = new AreaVisitor();
		ToStringVisitor toStringVisitor = new ToStringVisitor();
		
		for(Shape shape : shapes) 
			System.out.println(shape.accept(toStringVisitor) + " has an area of " + shape.accept(areaVisitor));
	}
}
